//
//  SearchView.m
//  TheRoadAD
//
//  Created by baixue on 16/9/10.
//  Copyright © 2016年 baixue. All rights reserved.
//

#import "SearchView.h"
#import "SearchViewViewController.h"

@implementation SearchView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = [UIColor colorWithRed:0.95 green:0.95 blue:0.95 alpha:1];
        
        UIImageView *image = [[UIImageView alloc] initWithFrame:CGRectMake(15, 5, Screen_Width-30, 50 * Screen_Height/736 - 10)];
        [self addSubview:image];
        image.image = [UIImage imageNamed:@"sousuo"];
        
        UITextField *TF = [[UITextField alloc] initWithFrame:CGRectMake(25, 5, Screen_Width-35, 50 * Screen_Height/736 - 10)];
        [self addSubview:TF];
        TF.placeholder = @"搜索";
        TF.leftView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon_home_meitu_2"]];
        TF.leftViewMode = UITextFieldViewModeAlways;
        TF.enabled = NO;
        
        self.userInteractionEnabled = YES;
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(searchNext)];
        [self addGestureRecognizer:tap];
        
       
        
    }
    return self;
}


//点击跳转搜索页面
- (void)searchNext{
   
    _SEARCH();
}

@end
